'use strict';

module.exports = app => {
  const { STRING, INTEGER, TEXT, DATE, JSON } = app.Sequelize;

  const ResumeTemplate = app.model.define('resume_template', {
    id: {
      type: INTEGER,
      primaryKey: true,
      autoIncrement: true,
      comment: '模板ID'
    },
    name: {
      type: STRING(100),
      allowNull: false,
      comment: '模板名称'
    },
    description: {
      type: STRING(255),
      allowNull: true,
      comment: '模板描述'
    },
    template_data: {
      type: JSON,
      allowNull: false,
      comment: '模板完整数据（JSON格式）'
    },
<<<<<<< HEAD
=======
    user_id: {
      type: INTEGER,
      allowNull: true,
      comment: '创建者用户ID'
    },
>>>>>>> resume
    is_active: {
      type: INTEGER,
      defaultValue: 1,
      comment: '是否启用：1-启用，0-禁用'
    }
  }, {
    tableName: 'resume_template',
    timestamps: true,
    underscored: true,
    createdAt: 'created_at',
    updatedAt: 'updated_at'
  });

  return ResumeTemplate;
};

